package com.aboo.parameter;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.hibernate.Query;

public class ParameterSetHelper {

	public static void setParameter(Query query, Map<String, Object> params) {
		if (params != null) {
			Set<String> keys = params.keySet();
			if (keys != null) {
				String key = null;
				for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
					key = iter.next();
					query.setParameter(key, params.get(key));
				}
			}
		}
	}

}
